package cn.tedu.ba05;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

import java.util.Date;

@Aspect
@Component("MyAspect")
public class MyAspect {
    @Around(value = "route()")
    public void myAround(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("记录时间"+new Date());
        pjp.proceed();
        System.out.println("提交事务");
    }

    @Pointcut(value = "execution(* cn.tedu.ba05.SomeServiceImpl.*(..))")
    public void route(){}
}
